require 'title'
class Album 
	attr_accessor :name, :titles
	def initialize(name)
		@titles = Hash.new
		@name = name
	end

	def parse(node)
		@name = node["name"]
		node.find(node.path + '/title').each() do |n|
			title = Title.new("", "", 0)
			title.parse(n)
			@titles[title.name] = title
		end
	end

	def add_title(title)
		@titles.push(title)
	end

	def print()
		puts "album " + @name + "\n"
		@titles.each do |key, val|
			val.print()
		end
	end
end
